import Vue from 'vue'
import Router from 'vue-router'
import index from '../components/index'

Vue.use(Router)

function route (path, file, name, children) {
  return {
    exact: true,
    path,
    name,
    children,
    component: () => import('../components' + file + '.vue')
  }
}

export default new Router({
  routes: [
    {
      path:"/",component:index,//重定向,
      children:[
        route('/item/goodsList', '/GoodsList', 'goodsList'),// /login路径，路由到登录组件
        route('/item/goodsList/goodsList', '/GoodsList/GoodsList', 'goodsList'),// /login路径，路由到登录组件
      ]
    },
  ]
})
